<?php
/** 
 * Drug_list_model
 * This class is used for the Ajax searching for a drug name 
 * 
 * @author Ray Nowell
 *	
 */
class Drug_list_model extends Model {

	function Drug_list_model()
	{
		parent::Model();
	}
	
	function seek_drugs( $drug_match )
	{
		//$this->output->enable_profiler(TRUE);
		$this->db->select('drug_id');
		$this->db->select('CONCAT(`generic_desc`,\' - \', `item_desc`) AS full_drug_description', FALSE);
		$this->db->select('wholesale_each_cost'); //Unit Cost
		$this->db->select('doses_per_day'); 
		$this->db->like('item_desc',$drug_match);
		$this->db->or_like('generic_desc', $drug_match);
		$this->db->order_by('`generic_desc`, `item_desc`'); 
		$query=$this->db->get('drug_list', 8); //REN:  Eight keeps it on the form
		
		return $query->result();
	}	
	
	
	
}

/* End of file drug_list_model.php */
/* Location: ./system/application/models/drug_list_model.php */